<template>
	<div class="takeAlap">
		<web-view :src="src" @message="messaged"></web-view>
	</div>
</template>

<script>
	export default {
		data() {
			return {
				src: null,
				mapData: {}
			};
		},
		onLoad(option) {
			uni.setNavigationBarTitle({
				title: "走一圈",
			});
			if (option.type == '0') {
				this.src = "https://yunlzz.com.cnwxh5/?token=" +  this.$store.state.token;
			} else if (option.type == '1') {
				this.src = "https://yunlzz.com.cnwxh5/home/?token=" +  this.$store.state.token;
			}

		},
		mounted() {},
		methods: {
			messaged(e) {
				let par = e.target.data[0]
				if (par.action == 'sendData') {
					this.mapData = par.data
				}
			},
		},

		onUnload() {
			if (this.mapData.cuttingGeom) {
				uni.$emit('mapEvent', this.mapData); // 触发自定义事件，并传递参数
			}

		},
	};
</script>

<style scoped>
	page {
		width: 100%;
		height: 100%;
	}

	.takeAlap {
		height: 100%;
		width: 100%;
		padding-top: 200px;
	}
</style>